home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Include / GuiSlider.au3 < prev    next >
Encoding:
Text File  |  2007-09-08  |  10.9 KB  |  214 lines

  1. #include-once
  2. #include <SliderConstants.au3>
  3. #include <Misc.au3>
  4.  
  5. ; ------------------------------------------------------------------------------
  6. ;
  7. ; AutoIt Version: 3.2.3++
  8. ; Language:       English
  9. ; Description:    Functions that assist with Slider Control "Trackbar".
  10. ;
  11. ; ------------------------------------------------------------------------------
  12.  
  13. ; function list
  14. ;===============================================================================
  15. ; _GUICtrlSliderClearTics
  16. ; _GUICtrlSliderGetLineSize
  17. ; _GUICtrlSliderGetNumTics
  18. ; _GUICtrlSliderGetPageSize
  19. ; _GUICtrlSliderGetPos
  20. ; _GUICtrlSliderGetRangeMax
  21. ; _GUICtrlSliderGetRangeMin
  22. ; _GUICtrlSliderSetLineSize
  23. ; _GUICtrlSliderSetPageSize
  24. ; _GUICtrlSliderSetPos
  25. ; _GUICtrlSliderSetTicFreq
  26. ;===============================================================================
  27.  
  28. ;===============================================================================
  29. ;
  30. ; Description:            _GUICtrlSliderClearTics
  31. ; Parameter(s):        $h_slider - handle of the control
  32. ; Requirement:            None
  33. ; Return Value(s):    None
  34. ; User CallTip:        _GUICtrlSliderClearTics($h_slider) Removes the current tick marks from a slider. (required: <GuiSlider.au3>)
  35. ; Author(s):            Gary Frost (custompcs at charter dot net)
  36. ; Note(s):                This does not remove the first and last tick marks, which are created automatically
  37. ;
  38. ;===============================================================================
  39. Func _GUICtrlSliderClearTics($h_slider)
  40.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, 0)
  41.     _SendMessage($h_slider, $TBM_CLEARTICS, 1)
  42. EndFunc   ;==>_GUICtrlSliderClearTics
  43.  
  44. ;===============================================================================
  45. ;
  46. ; Description:            _GUICtrlSliderGetLineSize
  47. ; Parameter(s):        $h_slider - handle of the control
  48. ; Requirement:            None
  49. ; Return Value(s):    Returns value that specifies the line size for the slider.
  50. ; User CallTip:        _GUICtrlSliderGetLineSize($h_slider) Retrieves the number of logical positions the slider moves. (required: <GuiSlider.au3>)
  51. ; Author(s):            Gary Frost (custompcs at charter dot net)
  52. ; Note(s):                Retrieves the number of logical positions the slider moves in response to keyboard input from the arrow keys.
  53. ;                            The logical positions are the integer increments in the slider's range of minimum to maximum slider positions.
  54. ;
  55. ;===============================================================================
  56. Func _GUICtrlSliderGetLineSize($h_slider)
  57.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, 0)
  58.     Return _SendMessage($h_slider, $TBM_GETLINESIZE)
  59. EndFunc   ;==>_GUICtrlSliderGetLineSize
  60.  
  61. ;===============================================================================
  62. ;
  63. ; Description:            _GUICtrlSliderGetNumTics
  64. ; Parameter(s):        $h_slider - handle of the control
  65. ; Requirement:            None
  66. ; Return Value(s):    If no tick flag is set, it returns 2 for the beginning and ending ticks.
  67. ;                            If $TBS_NOTICKS is set, it returns zero.
  68. ;                            Otherwise, it takes the difference between the range minimum and maximum, divides by the tick frequency, and adds 2.
  69. ; User CallTip:        _GUICtrlSliderGetNumTics($h_slider) Retrieves the number of tick marks from a slider. (required: <GuiSlider.au3>)
  70. ; Author(s):            Gary Frost (custompcs at charter dot net)
  71. ; Note(s):
  72. ;
  73. ;===============================================================================
  74. Func _GUICtrlSliderGetNumTics($h_slider)
  75.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  76.     Return _SendMessage($h_slider, $TBM_GETNUMTICS)
  77. EndFunc   ;==>_GUICtrlSliderGetNumTics
  78.  
  79. ;===============================================================================
  80. ;
  81. ; Description:            _GUICtrlSliderGetPageSize
  82. ; Parameter(s):        $h_slider - handle of the control
  83. ; Requirement:            None
  84. ; Return Value(s):    Returns a value that specifies the page size for the slider.
  85. ; User CallTip:        _GUICtrlSliderGetPageSize($h_slider) Retrieves the number of logical positions the slider moves. (required: <GuiSlider.au3>)
  86. ; Author(s):            Gary Frost (custompcs at charter dot net)
  87. ; Note(s):                Retrieves the number of logical positions the slider moves in response to keyboard input,
  88. ;                            or mouse input, such as clicks in the sliders's channel.
  89. ;                            The logical positions are the integer increments in the slider's range of minimum to maximum slider positions.
  90. ;
  91. ;===============================================================================
  92. Func _GUICtrlSliderGetPageSize($h_slider)
  93.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  94.     Return _SendMessage($h_slider, $TBM_GETPAGESIZE)
  95. EndFunc   ;==>_GUICtrlSliderGetPageSize
  96.  
  97. ;===============================================================================
  98. ;
  99. ; Description:            _GUICtrlSliderGetPos
  100. ; Parameter(s):        $h_slider - handle of the control
  101. ; Requirement:            None
  102. ; Return Value(s):    Returns a value that specifies the logical position of the slider.
  103. ; User CallTip:        _GUICtrlSliderGetPos($h_slider) Retrieves the logical position the slider. (required: <GuiSlider.au3>)
  104. ; Author(s):            Gary Frost (custompcs at charter dot net)
  105. ; Note(s):
  106. ;
  107. ;===============================================================================
  108. Func _GUICtrlSliderGetPos($h_slider)
  109.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  110.     Return _SendMessage($h_slider, $TBM_GETPOS)
  111. EndFunc   ;==>_GUICtrlSliderGetPos
  112.  
  113. ;===============================================================================
  114. ;
  115. ; Description:            _GUICtrlSliderGetRangeMax
  116. ; Parameter(s):        $h_slider - handle of the control
  117. ; Requirement:            None
  118. ; Return Value(s):    Returns a value that specifies the maximum position in the slider's range of minimum to maximum slider positions.
  119. ; User CallTip:        _GUICtrlSliderGetRangeMax($h_slider) Retrieves the maximum position for the slider. (required: <GuiSlider.au3>)
  120. ; Author(s):            Gary Frost (custompcs at charter dot net)
  121. ; Note(s):
  122. ;
  123. ;===============================================================================
  124. Func _GUICtrlSliderGetRangeMax($h_slider)
  125.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  126.     Return _SendMessage($h_slider, $TBM_GETRANGEMAX)
  127. EndFunc   ;==>_GUICtrlSliderGetRangeMax
  128.  
  129. ;===============================================================================
  130. ;
  131. ; Description:            _GUICtrlSliderGetRangeMin
  132. ; Parameter(s):        $h_slider - handle of the control
  133. ; Requirement:            None
  134. ; Return Value(s):    Returns a value that specifies the minimum position in the slider's range of minimum to maximum slider positions.
  135. ; User CallTip:        _GUICtrlSliderGetRangeMin($h_slider) Retrieves the minimum position for the slider. (required: <GuiSlider.au3>)
  136. ; Author(s):            Gary Frost (custompcs at charter dot net)
  137. ; Note(s):
  138. ;
  139. ;===============================================================================
  140. Func _GUICtrlSliderGetRangeMin($h_slider)
  141.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  142.     Return _SendMessage($h_slider, $TBM_GETRANGEMIN)
  143. EndFunc   ;==>_GUICtrlSliderGetRangeMin
  144.  
  145. ;===============================================================================
  146. ;
  147. ; Description:            _GUICtrlSliderSetLineSize
  148. ; Parameter(s):        $h_slider - handle of the control
  149. ;                            $i_linesize - New line size.
  150. ; Requirement:            None
  151. ; Return Value(s):    Returns a value that specifies the previous line size.
  152. ; User CallTip:        _GUICtrlSliderSetLineSize($h_slider, $i_linesize) Sets the number of logical positions the slider moves. (required: <GuiSlider.au3>)
  153. ; Author(s):            Gary Frost (custompcs at charter dot net)
  154. ; Note(s):                Sets the number of logical positions the slider moves in response to keyboard input from the arrow keys.
  155. ;                            The logical positions are the integer increments in the slider's range of minimum to maximum slider positions.
  156. ;
  157. ;===============================================================================
  158. Func _GUICtrlSliderSetLineSize($h_slider, $i_linesize)
  159.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  160.     Return _SendMessage($h_slider, $TBM_SETLINESIZE, 0, $i_linesize)
  161. EndFunc   ;==>_GUICtrlSliderSetLineSize
  162.  
  163. ;===============================================================================
  164. ;
  165. ; Description:            _GUICtrlSliderSetPageSize
  166. ; Parameter(s):        $h_slider - handle of the control
  167. ;                            $i_pagesize - New page size.
  168. ; Requirement:            None
  169. ; Return Value(s):    Returns a value that specifies the previous page size.
  170. ; User CallTip:        _GUICtrlSliderSetPageSize($h_slider, $i_pagesize) Sets the number of logical positions the slider moves. (required: <GuiSlider.au3>)
  171. ; Author(s):            Gary Frost (custompcs at charter dot net)
  172. ; Note(s):                Sets the number of logical positions the slider moves in response to keyboard input,
  173. ;                            or mouse input, such as clicks in the slider's channel.
  174. ;                            The logical positions are the integer increments in the slider's range of minimum to maximum slider positions.
  175. ;
  176. ;===============================================================================
  177. Func _GUICtrlSliderSetPageSize($h_slider, $i_pagesize)
  178.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  179.     Return _SendMessage($h_slider, $TBM_SETPAGESIZE, 0, $i_pagesize)
  180. EndFunc   ;==>_GUICtrlSliderSetPageSize
  181.  
  182. ;===============================================================================
  183. ;
  184. ; Description:            _GUICtrlSliderSetPos
  185. ; Parameter(s):        $h_slider - handle of the control
  186. ;                            $i_pos - New logical position of the slider.
  187. ; Requirement:            None
  188. ; Return Value(s):    None
  189. ; User CallTip:        _GUICtrlSliderSetPos($h_slider, $i_pos) Sets the current logical position of the slider. (required: <GuiSlider.au3>)
  190. ; Author(s):            Gary Frost (custompcs at charter dot net)
  191. ; Note(s):
  192. ;
  193. ;===============================================================================
  194. Func _GUICtrlSliderSetPos($h_slider, $i_pos)
  195.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  196.     _SendMessage($h_slider, $TBM_SETPOS, 1, $i_pos)
  197. EndFunc   ;==>_GUICtrlSliderSetPos
  198.  
  199. ;===============================================================================
  200. ;
  201. ; Description:            _GUICtrlSliderSetTicFreq
  202. ; Parameter(s):        $h_slider - handle of the control
  203. ;                            $i_freq - Frequency of the tick marks.
  204. ; Requirement:            None
  205. ; Return Value(s):    None
  206. ; User CallTip:        _GUICtrlSliderSetTicFreq($h_slider, $i_freq) Sets the interval frequency for tick marks in a slider. (required: <GuiSlider.au3>)
  207. ; Author(s):            Gary Frost (custompcs at charter dot net)
  208. ; Note(s):                The slider must have the $TBS_AUTOTICKS style to use this.
  209. ;
  210. ;===============================================================================
  211. Func _GUICtrlSliderSetTicFreq($h_slider, $i_freq)
  212.     If Not _IsClassName ($h_slider, "msctls_trackbar32") Then Return SetError(-1, -1, -1)
  213.     _SendMessage($h_slider, $TBM_SETTICFREQ, $i_freq)
  214. EndFunc   ;==>_GUICtrlSliderSetTicFreq